package lec09.pm;

import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;

public class QueueDemo {
	public static void main(String[] args) {
		Random random = new Random();
		Queue<Integer> queue = new PriorityQueue<Integer>();
		for (int i = 0; i < 10; i++) {
			queue.add(random.nextInt(10));
			System.out.println(queue);
		}
		while (!queue.isEmpty()) {
			System.out.println(queue.poll());
		}
	}
}
